//
//  chooseVechileCell.m
//  WHB_logist
//
//  Created by 徐国庆 on 15/12/22.
//  Copyright (c) 2015年 turing. All rights reserved.
//

#import "chooseVechileCell.h"

@implementation chooseVechileCell

- (void)awakeFromNib {
    // Initialization code
    
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 最上端的线
        self.topLineLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.topLineLabel];
        self.topLineLabel.layer.borderWidth = 0.5;
        
        
        // 选中按钮
        self.chooseButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.chooseButton];
        
        // 图片
        self.vechileImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.vechileImageView];
        
        // 车牌号
        self.vechileNumberLabel = [[UILabel alloc] init];
        self.vechileNumberLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.vechileNumberLabel];
        
        // 司机
        self.driverLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.driverLabel];
        
        // 重量
        self.weightLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.weightLabel];
        
        // 路线
        self.roadLineView = [[UIView alloc]init];
        [self.contentView addSubview:self.roadLineView];
        
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.topLineLabel.frame = CGRectMake(0, 0, self.contentView.frame.size.width + 200, 10);
    self.chooseButton.frame = CGRectMake(10, self.topLineLabel.frame.size.height + 30, 25, 25);
    self.vechileImageView.frame = CGRectMake(self.chooseButton.frame.size.width + 20, self.topLineLabel.frame.size.height + 10, 50, 50);
    self.vechileNumberLabel.frame = CGRectMake(self.vechileImageView.frame.origin.x, self.vechileImageView.frame.origin.y + self.vechileImageView.frame.size.height, 100, 20);
    self.driverLabel.frame = CGRectMake(self.vechileImageView.frame.origin.x + self.vechileImageView.frame.size.width + 10, self.vechileImageView.frame.origin.y, 100, 20);
    self.weightLabel.frame = CGRectMake(self.driverLabel.frame.origin.x + self.driverLabel.frame.size.width, self.driverLabel.frame.origin.y, 100, 20);
    self.roadLineView.frame = CGRectMake(self.vechileImageView.frame.origin.x + self.vechileImageView.frame.size.width, self.weightLabel.frame.origin.y + self.weightLabel.frame.size.height , 50, 20);
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end














